/*
 * @Author: Bennty
 * @Date: 2024-07-24 13:39:42
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-09-20 15:19:47
 * @Description: 请填写简介
 */

import request from '@/utils/request';

/** 查询福利申请记录列表 */
export const getApplyListApi = (data: any)=>{
    return request({
        url: '/system/welfareApplyRecord/list',
        method: 'post',
        data: data
    })
};

/** 新增福利申请记录 */
export const addWelfareApply = (data: any) => {
    return request({
        url: '/system/welfareApplyRecord',
        method: 'post',
        data: data
    });
};

/** 根据客户星级查询可选福利品 */
export const getWelfareByLevelApi = (level: any) => {
    return request({
        url: '/system/welfareInfo/getWelfareByLevel',
        method: 'get',
        params: {level: level}
    })
};

/** 获取福利申请记录 详细信息 */
export const getWelfareByIdApi = (id: number | string | undefined) => {
    return request({
        url: `/system/welfareApplyRecord/${id}`,
        method: 'get'
    })
};

/** 删除福利申请记录 */
export const deleteWelfareApi = (ids: any) => {
    return request({
        url: `/system/welfareApplyRecord/${ids}`,
        method: 'delete'
    })
};

/** 审批福利申请 */
export const applyWelfareApi = (params: any) => {
    return request({
        url: `/system/welfareApplyRecord/approval`,
        method: 'delete',
        params: params
    })
};

/** 审批福利修改 */
export const updateWelafareApi = (data: any) => {
    return request({
        url: `/system/welfareApplyRecord`,
        method: 'put',
        data: data
    })
};

/** 根据客户编号查询样品申请记录 */
export const getApplyRecordApi = (params: any) => {
    return request({
        url: `/system/welfareApplyRecord/getSampleByCustomerId`,
        method: 'get',
        params: params
    })
};